const share = {
	TARGET_MYSELF:'TARGET_MYSELF',
	SHARE_STYLE:{
		PAGE: "page"
	},
	encodeShareParameter(style, target, params) {
		console.log("shareParameter")
		let encodeParamter = 'key=' + style + '&target=' + target + '&params=' + encodeURIComponent(JSON.stringify(params))
		return encodeParamter;
	},
	decodeShareParameter(style, encodeObj) {
		let decodedParams = {};
		if(style === "page") {
			decodedParams.params = JSON.parse(decodeURIComponent(encodeObj.params));
			decodedParams.target = encodeObj.target
		} 
		return decodedParams;
	},
}
export default share;